import { BaseSys } from "../BaseSys";
import { MoveSystem } from "../testEcs/MoveSystem";
import { DSystem } from "./system/DSystem";
/**
 * 世界管理器
 */
export class WorldMgr extends BaseSys {
    //所有的系统在这里处理
    private _systems: { [prority: number]: DSystem } = {}
    constructor() {
        super()
        this.init()
    }
    public static ins(): WorldMgr {
        return super.ins();
    }
    private addSys(prority: number, sys: DSystem) {
        this._systems[prority] = sys;
    }
    public init() {
        this.addSys(1, MoveSystem.ins());
    }

    public update() {
        for (let sid in this._systems) {
            let system = this._systems[sid];
            system.update();
        }
    }

}
